import type { DeliverType } from '@/pages/order/types'

/**
 * 订单状态
 * @param  UNPAID 未支付
 * @param  PAID 已支付
 * @param  BUYER_CLOSED 买家关闭订单
 * @param  SYSTEM_CLOSED 系统关闭订单
 * @param  SELLER_CLOSED 卖家关闭订单
 * @param  TEAMING 拼团中
 * @param  TEAM_FAIL 拼团失败
 */
export enum ORDERSTATUS {
  UNPAID,
  PAID,
  BUYER_CLOSED,
  SYSTEM_CLOSED,
  SELLER_CLOSED,
  TEAMING,
  TEAM_FAIL,
}
/**
 * 包裹状态
 * @param  WAITING_FOR_DELIVER 待发货
 * @param WAITING_FOR_RECEIVE  待收货
 * @param BUYER_WAITING_FOR_COMMENT 买家确认收货 待评价
 * @param SYSTEM_WAITING_FOR_COMMENT 系统确认收货 待评价
 * @param BUYER_COMMENTED_COMPLETED 买家已评论 已完成
 * @param SYSTEM_COMMENTED_COMPLETED 系统自动好评 已完成
 */
export enum PACKAGESTATUS {
  WAITING_FOR_DELIVER,
  WAITING_FOR_RECEIVE,
  BUYER_WAITING_FOR_COMMENT,
  SYSTEM_WAITING_FOR_COMMENT,
  BUYER_COMMENTED_COMPLETED,
  SYSTEM_COMMENTED_COMPLETED,
}
export type OrderRuleEnum = keyof typeof ORDERSTATUS
export type OrderRuleConfig = Record<'title' | 'text' | 'img' | 'bgColor', string>
/**
 * 订单详情状态规则
 * @param {string} tradeClose 订单关闭
 */
export type OrderStatusRule = Record<OrderRuleEnum, OrderRuleConfig>
/**
 * 第一个包裹的物流查询接口返回类型
 */
export interface ApiLogistics01 {
  createTime: string
  deleted: boolean
  expressCompanyCode: string
  expressCompanyName: string
  expressNo: string
  id: string
  orderNo: string
  receiverAddress: string
  receiverMobile: string
  receiverName: string
  remark: string
  shopId: string
  status: keyof typeof PACKAGESTATUS
  type: keyof typeof DeliverType
  updateTime: string
  version: 0
  success: boolean
}
